<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
    <title>拾光&nbsp;•&nbsp;失物招领</title>
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection"content="telephone=no, email=no" />
    <meta name="renderer" content="webkit">

    <meta name="title" content="拾光&nbsp;•&nbsp;失物招领" />
    <meta name="img" content="http://source.timepicker.cn/uploads/default/laf.png-120" />
    <meta name="description" content="不管是捡了东西还是丢了东西都来这里看看吧" />
    
    <!--icon-->
    <link rel="shortcut icon" href="http://source.timepicker.cn/uploads/default/laf.png-120" />
    <!--拾光css-->
    <link rel="stylesheet" href="http://source.timepicker.cn/static/css/ptime_v0.4.min.css">
    <!-- 小应用css -->
    <link rel="stylesheet" href="/css/style.css">
    <!-- animate css -->
    <link rel="stylesheet" href="http://source.timepicker.cn/static/css/animate.min.css">
    <link rel="stylesheet" href="http://source.timepicker.cn/static/css/swiper.min.css">
    <!--主题css-->
    <style type="text/css">
      a{color: #a8c0d8;}   /* 未访问的链接 */
      .active{color:#a8c0d8 !important; border-color: #a8c0d8 !important;}
      nav ul li a.current{color: #a8c0d8;border-color: #a8c0d8;}
      .mcolor{color: #a8c0d8;}
      .bg-mcolor{background-color: #a8c0d8 !important;}
      .button.mcolor{border-color:#a8c0d8;}
      .button.mcolor.active{background-color: #a8c0d8;}
      .label.current{background-color: #a8c0d8;}
      #top-a{background-color: #a8c0d8;}
    </style>
</head>

<body class="agent-{{ua}}">
    <!--头部-->
    <header class="bg-mcolor fixed top" >
        <h1>拾光&nbsp;•&nbsp;失物招领</h1>
        <span class="button top-right white" onclick="share()">分享</span>
    </header>
    <!--其他区域-->
    <section class="border-bottom">
      <div class="swiper-container">
        <div class="swiper-wrapper">
          {{#each result.laf.images}}
            <div class="swiper-slide">
              <img class="swiper-image" src="{{this}}">
            </div>
          {{/each}}
        </div>
        <!-- Add Pagination -->
        <div class="swiper-pagination swiper-pagination-white swiper-page"></div>
      </div>
    </section>
    <section>
      <div class="lafitem" id="{{this._id}}">
        <p class="title-detail">{{result.laf.title}}</p>
        <p class="content-detail">{{result.laf.intro}}</p>
        <p class="content-detail"><i class="icon iconfont">&#xe630;</i> {{result.laf.position}}</p>
        {{#if @root.result.token}}
          <p class="content-detail"><i class="icon iconfont">&#xe667;</i> {{result.laf.userName}}</p>
          {{#if @root.result.token}}
            {{#if @root.isApp}}
              {{#if @root.result.laf.isMine}}
                <a class="filled-button delete red-back">删除</a>
              {{else}}
                <a class="filled-button contact" alt="{{result.laf.contact}}">联系</a>
              {{/if}}
            {{/if}}
          {{/if}}
          <p class="content-detail"><i class="icon iconfont">&#xe609;</i> {{result.laf.contact}}</p>
        {{/if}}
        <div class="clear"></div>
        {{#if result.laf.tags.length}}
          <hr>
          {{#each result.laf.tags}}
            <span class="label">{{name}}</span>
          {{/each}}
        {{/if}}
      </div>
    </section>
    <!-- 分享 -->
    <div id="share-box">
     <div id="share-top-box">
        <h4>分享至：</h4>   
        <div class="bdsharebuttonbox">
          <a href="#" class="bds_sqq" data-cmd="sqq" title="分享到QQ好友"></a>
          <a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a>
          <a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a>
        </div>
     </div>
    </div>
    <div id="toast-box" ></div>
    <!--拾光js-->
    <script type="text/javascript" src="http://source.timepicker.cn/static/js/ptime_v0.4.min.js"></script>
    <script type="text/javascript" src="http://source.timepicker.cn/static/js/swiper.jquery.min.js"></script>
    <script type="text/javascript">
      // 网页分享
      if ('{{ua}}' == 'other') {
        var img_url = '';
        if ($('meta[name="img"]')[0].content) {
            img_url = $('meta[name="img"]')[0].content;
        }else{
            img_url = typeof($('img')[0])!='undefined'?$('img')[0].src:$('link[rel="shortcut icon"]')[0].href;
        };
        window._bd_share_config = {
            common : {
                bdText : $('meta[name="title"]')[0].content, 
                bdDesc : $('meta[name="description"]')[0].content, 
                bdUrl  : window.location.href,   
                bdPic  : img_url
            },
            share : [{
                "bdSize" : 24
            }]
        }
        with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?cdnversion='+~(-new Date()/36e5)];
      }
    </script>

    <script type="text/javascript" src="/js/index.js"></script>
    <script type="text/javascript" src="/js/detail.js"></script>

    <script type="text/javascript">
      $('.contact').on(getListenEvent(), function (e) {
        if (!$(this).prehandler.handler(e)) return;
        jbPhoneCall('{{ua}}', $(this).attr('alt'))
      })
      $('.delete').on(getListenEvent(), function (e) {
        if (!$(this).prehandler.handler(e)) return;
        $.ajax({
          url: '/laf/{{result.laf._id}}',
          type: 'delete',
          success: function (data) {
            if (data.error > 0) {
              toast(data.message);
            } else {
              toast('删除成功，正在跳转...')
              location.href = document.referrer
            }
          },
          error: function (data) {
            toast('程序员正在打瞌睡，打个电话给他？');
          }
        })
      })
    </script>
</body>
</html>